#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>

#include "mnetworktask.h"

namespace Ui {
class MainWindow;
}

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    explicit MainWindow(QWidget *parent = nullptr);
    ~MainWindow();
signals:
    void sendDevAddr_XHY(QString rmtIP, unsigned short rmtPort);
    void sendDevAddr_PPY(QString rmtIP, unsigned short rmtPort);

    void send_disconnect_xxy();
    void send_disconnect_ppy();

    void send_query_xxy();
    void send_query_ppy();


private slots:
    void on_btn_cnct_xhy_clicked();

    void on_btn_cnct_ppy_clicked();

    void on_btn_dsct_xhy_clicked();

    void on_btn_dsct_ppy_clicked();

    void on_btn_qruy_xhy_clicked();

    void on_btn_qruy_ppy_clicked();

    void task01_recv_msg(QByteArray recvMsg);
    void task02_recv_msg(QByteArray recvMsg);

private:
    Ui::MainWindow *ui;

    QThread* m_sub_thread1;
    QThread* m_sub_thread2;
    NetworkTask_01* task01;
    NetworkTask_02* task02;
};

#endif // MAINWINDOW_H
